package com.nuo.common.core.constant;

/**
 * 安全相关常量定义
 *
 * @author LGC
 * @date 2022/1/26 14:40
 */
public interface SecurityConstants {
    /**
     * 认证请求头key
     */
    String AUTHORIZATION_KEY = "Authorization";

    /**
     * JWT令牌前缀
     */
    String JWT_PREFIX = "Bearer ";


    /**
     * Basic认证前缀
     */
    String BASIC_PREFIX = "Basic ";

    /**
     * JWT载体key
     */
    String JWT_PAYLOAD_KEY = "payload";

    /**
     * JWT ID 唯一标识
     */
    String JWT_JTI = "jti";

    /**
     * JWT ID 唯一标识
     */
    String JWT_EXP = "exp";
    /**
     * JWT存储权限前缀
     */
    String AUTHORITY_PREFIX = "ROLE_";
    /**
     * JWT存储权限属性
     */
    String JWT_AUTHORITIES_KEY = "authorities";

    /**
     * 授权方式
     */
    String GRANT_TYPE_KEY = "grant_type";

    /**
     * 刷新token
     */
    String REFRESH_TOKEN_KEY = "refresh_token";

    /**
     * 客户端ID
     */
    String CLIENT_ID_KEY = "client_id";

    String USER_ID_KEY = "userId";

    String USER_NAME_KEY = "username";

    /**
     * 认证方式
     */
    String AUTHENTICATION_METHOD = "authenticationMethod";

    /**
     * 接口文档 Knife4j 测试客户端ID
     */
    String TEST_CLIENT_ID = "client";

    /**
     * 后台管理web客户端ID
     */
    String ADMIN_CLIENT_ID = "nuo-mall-admin-web";

    /**
     * 移动端（H5/Android/IOS）客户端ID
     */
    String APP_CLIENT_ID = "nuo-mall-app";

    /**
     * 小程序端（微信小程序、....） 客户端ID
     */
    String WEAPP_CLIENT_ID = "mall-weapp";

    /**
     * 验证码key前缀
     */
    String VALIDATION_CODE_KEY_PREFIX = "CAPTCHA:";

    /**
     * 短信验证码key前缀
     */
    String SMS_CODE_PREFIX = "SMS_CODE:";

    /**
     * 邮箱验证码key前缀
     */
    String MAIL_CODE_PREFIX = "mail_code:";


    /**
     * 黑名单token前缀
     */
    String TOKEN_BLACKLIST_PREFIX = "auth:token:blacklist:";

    /**
     * app相关接口请求路径
     */
    String APP_API_PATTERN = "/*/app-api/**";

    /**
     * 退出登录请求路径
     */
    String LOGOUT_PATH = "/nuo-auth/oauth/logout";



}
